package com.byq.mm.abstractx.engine;


import com.byq.mm.abstractx.cluster.server.ClientEntry;
import com.byq.mm.abstractx.cluster.server.ServerIdentifier;
import com.byq.mm.abstractx.device.Device;
import com.byq.mm.abstractx.protocol.Interaction;

import java.util.Collection;

public interface CoreStore {
	public Collection<Device> findRootDevices();
	public void deleteDevice(Device device);
	public void saveDevice(Device device);

	public abstract Collection<ClientEntry> findClientEntrys(String deviceId, String clusterId);

	public abstract void updateClientEntry(String deviceId, String clusterId,
			ClientEntry ce);

	public abstract void saveClientEntry(String deviceId, String clusterId,
			ClientEntry e);
	public abstract void refuseInteraction(Interaction i, String from);
	public abstract void acceptInteraction(Interaction i, String from);
	void savePermission(ServerIdentifier id, boolean permit);
	boolean existPermission(ServerIdentifier id);
	boolean findPermission(ServerIdentifier id);
	public void updatePermission(ServerIdentifier id, boolean permitted);
}
